package jsp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/4/14 10:03
 * Version:1.0-SNAPSHOT
 * Description:
 */
@WebServlet("/js")
public class JSTLServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int age = 20;
        request.setAttribute("age",age);
        if(age < 5){
            System.out.println("");
        }
        if(age < 16){
            System.out.println("");
        }
        if(age < 5){
            System.out.println("");
        } else if(age < 18){
            System.out.println("");
        } else{
            System.out.println("");
        }
        request.setAttribute("now",new Date());
        request.getRequestDispatcher("/jsp/jstl.jsp").forward(request,response);
    }

}
